#ifndef PSEGYTOSEGYTHREAD_H
#define PSEGYTOSEGYTHREAD_H

#include <QThread>
#include "util/define.h"
#include "datatype/segy.h"
#include "QFile"
#include "config/common.h"
#include "datatype/psegy.h"
#include "util/Dec.h"
#include "util/NavFile.h"
class Parin
{
public:
    float rv;                 //(float,km/s)------:reduced velocity.
    int length;//(int,s)------:length in seconds.
    int  tcoor;//(int,s)------:seconds before the reduced time.
    float lon0;//(float,degree)------:Central meridian of UTM zones,eg.Zone 50 is 117E.
    float ex;//(float,m)------:x calibration of the distance between
    //     FIX(GPS antenna) and the airgun.
    float ey;//(float,m)------:y calibration of the distance between
    //       FIX(GPS antenna) and the airgun.
    float  et;//(float,s)------:time calibration of the airgun delay.
    float zhongcha;
};

class PsegyToSegyThread : public QThread
{
    Q_OBJECT
public:
    explicit PsegyToSegyThread(QObject *parent = 0);
    PsegyToSegyThread( QList<QString> fileList,QString saveDir,QString decName,QString navName);
    void setFileList(const QList<QString> fileList);
    void setSavaDir(const QString saveDir);
    void setNavName(const QString navName);
    void setDecName(const QString decName);
    void setMerge(bool merge);

    void setFormat(int format);
signals:
    void fileFinish(QString name);
    void allFinish();
    void showStr(QString str);
public slots:

private:
    QList<QString> fileList;
    QString saveDir;
    QString decName;
    QString navName;
    Common *common;
    DATAFORMAT dataformat;
    bool merge;
    QList<Dec> *decList;
    QList<NavFile> *navList;
protected:
    void run();
    bool init();
    int format;
};

#endif // PSEGYTOSEGYTHREAD_H
